<?php /*a:1:{s:62:"D:\web\www\tp5.1\public/../app/admin\view\webconfig\index.html";i:1517465884;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>表单</title>
    <link rel="stylesheet" href="/static/frame/layui/css/layui.css">
    <link rel="stylesheet" href="/static/frame/static/css/style.css">
    <link rel="icon" href="/static/frame/static/image/code.png">
</head>
<body class="body">

<div class="system-table01">

<form class="layui-form" action="<?php echo url('admin/webconfig/edit','action='.Request::action()); ?>" method="post" id="editform">
    <table class="layui-table">
      <colgroup>
        <col width="20%">
        <col width="50%">
        <col>
        </colgroup>
        <thead>
          <tr>
            <th style="text-align: right">参数说明</th>
            <th align="center">参数值</th>
            <th align="center">变量名</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach($data as $key=>$vo): ?> 
          <tr>
            <td align="right"><?php echo htmlentities($vo['name']); ?></td>
            <td>    
    <?php if($vo['type'] == 0): ?>
      <?php echo createform('id-'.$vo['id'].'-'.$vo['varname'], $vo['value'], 0, $vo['typeval']); elseif($vo['type'] == 1): ?>
      <?php echo createform('id-'.$vo['id'].'-'.$vo['varname'], $vo['value'], 1, $vo['typeval']); elseif($vo['type'] == 2): ?>
      <?php echo createform('id-'.$vo['id'].'-'.$vo['varname'], $vo['value'], 2, $vo['typeval']); elseif($vo['type'] == 3): ?>
      <?php echo createform('id-'.$vo['id'].'-'.$vo['varname'], $vo['value'], 3, $vo['typeval']); elseif($vo['type'] == 4): ?>
      <?php echo createform('id-'.$vo['id'].'-'.$vo['varname'], $vo['value'], 4, $vo['typeval']); endif; ?>
  </td>
            <td><?php echo htmlentities($vo['varname']); ?>：<?php echo htmlentities($vo['info']); ?></td>
          </tr>
          <?php endforeach; ?>
        </tbody>
    </table>
    <div class="layui-form-item" style="text-align: right;">
      <div class="layui-input-block">
        <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="demo1">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>
    </div>
    <div class="layui-col-md3"><a class="layui-btn site-demo-active layui-btn-sm layui-btn-primary" data-type="tabAdd" id="addwebconfig" data-href="<?php echo url('admin/Webconfig/add'); ?>">添加系统配置数据</a></div>
  </form>
</div>

<!-- 通用-970*90 -->
<script src="/static/frame/layui/layui.js" charset="utf-8"></script>
<script src="/static/admin/js/comm.js" charset="utf-8"></script>
<script type="text/javascript">
layui.use(['form', 'table'], function() {
    var $ = layui.jquery,
        form = layui.form,
        table = layui.table;
    $('#addwebconfig').click(function() {
      href = $(this).attr('data-href');
      layer.alert('止配制为程序人员添加，请确定后再添加',function(index){
          layer.open({
            type: 2,
            area: ['700px', '650px'],
            fixed: false, //不固定
            maxmin: true,
            content: href
        });
        layer.close(index);
      });
    })
    
      form.on('submit(demo1)', function(data){
        $.post($('#editform').attr('action'),$("#editform").serialize(),function(data) {
                if (data.code == 1) {
                    layer.alert(data.msg,function(){
                      window.location.reload(true); 
                    });
                }
            });
        return false;
      });


});
</script>
</body>
</html>